import { DEFAULT_LAYOUT } from '../base';
import { AppRouteRecordRaw } from '../types';

const COURSES: AppRouteRecordRaw = {
  path: '/courses',
  name: 'CourseApp',
  component: DEFAULT_LAYOUT,
  meta: {
    locale: 'menu.courses',
    requiresAuth: true,
    icon: 'icon-relation',
    order: 300,
  },
  children: [
    {
      path: 'list',
      name: 'CourseListApp',
      component: () => import('@/views/courses/list/index.vue'),
      meta: {
        locale: 'menu.courses.list',
        requiresAuth: true,
        roles: ['*'],
      },
    },
    {
      path: 'invite',
      name: 'CourseInviteApp',
      component: () => import('@/views/courses/invite/index.vue'),
      meta: {
        locale: 'menu.courses.invite',
        requiresAuth: true,
        roles: ['*'],
      },
    },
    {
      path: 'data',
      name: 'CourseDataCourseApp',
      component: () => import('@/views/courses/only-for-data/index.vue'),
      meta: {
        locale: 'menu.courses.data',
        requiresAuth: true,
        roles: ['*'],
      },
    },
    {
      path: 'invite-detail',
      name: 'CourseInviteDetailApp',
      component: () => import('@/views/courses/invite/detail.vue'),
      meta: {
        locale: 'menu.courses.invite-detail',
        hideInMenu: true,
        requiresAuth: true,
        roles: ['*'],
      },
    },
    {
      path: 'detail',
      name: 'CourseDetailApp',
      component: () => import('@/views/courses/detail/index.vue'),
      meta: {
        locale: 'menu.courses.detail',
        requiresAuth: true,
        hideInMenu: true,
        roles: ['*'],
      },
    },
  ],
};

export default COURSES;
